const ImageToPdfConverter = require('../utils/CreatePdfFromImages');

const createPdfFn = async (event, config, mainWindow) => {
  try {
    // 创建PDF转换器实例
    const converter = new ImageToPdfConverter(config);
    
    // 执行转换
    const result = await converter.convert(mainWindow);
    return result;
  } catch (error) {
    console.error('创建PDF失败:', error);
    throw error;
  }
};

module.exports = {
  createPdfFn
};
